
import React, { Component } from 'react';
import { Route,Switch, BrowserRouter as Router } from 'react-router-dom'
import Cart from './components/cart/index';
import Category from './components/category/index';
import Home from './components/home/index';
import My from './components/my/index';
import Tabbar from './components/tabbar/index';
import Detail from './components/detail/index';
import SearchCenter from './components/searchCenter/SearchCenter';
import GoodList from './components/goodLilst/Index';
class RouterConfig extends Component {
  render() {
    return (
      <Router>
        <Switch>
          <Route path="/" exact render={() => <Tabbar><Home></Home></Tabbar> }></Route>
          <Route path="/category" exact render={() => <Tabbar><Category></Category></Tabbar> }></Route>
          <Route path="/cart" exact render={() =>  <Tabbar><Cart></Cart></Tabbar> }></Route>
          <Route path="/my" exact render={() =>  <Tabbar><My></My></Tabbar> }></Route>
          <Route path="/goodDetail/:goods_id" exact render={(props)=> <Detail {...props}></Detail>}></Route>
          <Route path="/searchCenter" exact render={()=> <SearchCenter></SearchCenter>}></Route>
          <Route path="/goodList/:query" exact render={(props)=> <GoodList {...props}></GoodList>}></Route>
        </Switch>
      </Router>
    );
  }
}

export default RouterConfig;
